package com.lvmama.task.service.dao;


import com.lvmama.task.common.dao.BaseIbatisDAO;
import com.lvmama.task.common.vo.TaskOperationLog;

import java.util.List;
import java.util.Map;

public class TaskOperationLogDAO extends BaseIbatisDAO {

    public Long insert(TaskOperationLog record) {
        return (Long) super.insert("TASK_OPERATION_LOG.insert", record);
    }

    public List<TaskOperationLog> queryByObjectIdMap(Map map) {
        Integer skipResults = (Integer) map.get("skipResults");
        Integer maxResults = (Integer) map.get("maxResults");

        Integer startNum = skipResults;
        Integer pageSize = maxResults - skipResults;

        map.put("startNum", startNum);
        map.put("pageSize", pageSize);
        return super.queryForList("TASK_OPERATION_LOG.selectMap", map);
    }

    public Long queryByObjectIdMapCount(Map map) {
        return (Long) super.queryForObject("TASK_OPERATION_LOG.selectMapCount", map);
    }

}